package com.shanzmoo.db.trade.service.impl;

import com.shanzmoo.db.trade.entity.PayOrderCallbackEntity;
import com.shanzmoo.db.trade.mapper.PayOrderCallbackMapper;
import com.shanzmoo.db.trade.service.IPayOrderCallbackService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 支付回调报文 服务实现类
 * </p>
 *
 * @author Gzhao
 * @since 2021-01-03
 */
@Slf4j
@Service
public class PayOrderCallbackServiceImpl extends ServiceImpl<PayOrderCallbackMapper, PayOrderCallbackEntity> implements IPayOrderCallbackService {

    @Override
    public void saveCallbackInfo(String payNo, boolean status, String notifyData){
        try {
            PayOrderCallbackEntity callbackEntity = new PayOrderCallbackEntity();
            callbackEntity.setPayNo(payNo);
            callbackEntity.setCallbackBody(notifyData);
            callbackEntity.setStatus(status);
        } catch (Exception e){
            log.error("支付回调结果保存失败", e);
        }

    }
}
